package com.intellif.mozping.factoryfunction;

import com.intellif.mozping.abstractfactory.factory.BusinessPhoneFactory;
import com.intellif.mozping.abstractfactory.factory.MusicPhoneFactory;
import com.intellif.mozping.factoryfunction.factory.Factory;
import com.intellif.mozping.factoryfunction.factory.HuaWeiFactory;
import com.intellif.mozping.factoryfunction.factory.VivoFactory;
import com.intellif.mozping.factoryfunction.producte.Phone;

import java.util.Random;

/**
 * 测试类
 * */
public class FactoryFunctionTest {
    public static void main(String[] args) {
        Factory factory;
        if (new Random().nextBoolean()) {
            factory = new HuaWeiFactory();
        } else {
            factory = new VivoFactory();
        }
        Phone phone = factory.createPhone();
        phone.call();
        phone.sendMsg();
    }
}
